﻿<Controls:MetroWindow x:Class="MetroDemo.MainWindow"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:MetroDemo="clr-namespace:MetroDemo"
                      xmlns:Dialog="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      xmlns:exampleViews="clr-namespace:MetroDemo.ExampleViews"
                      Title="MahApps.Metro - Demo Application"
                      Width="960"
                      Height="600"
                      Icon="mahapps.metro.logo2.ico"
                      ShowIconOnTitleBar="True"
                      ShowTitleBar="True"
                      WindowStartupLocation="CenterScreen"
                      GlowBrush="{DynamicResource AccentColorBrush}"
                      mc:Ignorable="d"
                      d:DesignHeight="600"
                      d:DesignWidth="800"
                      d:DataContext="{d:DesignInstance MetroDemo:MainWindowViewModel}"
                      Closing="MetroWindow_Closing">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatSlider.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <Canvas x:Key="appbar_github"
                    Width="48"
                    Height="48"
                    Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0"
                    UseLayoutRounding="False">
                <Path Width="43.4333"
                      Height="34.724"
                      Canvas.Left="2.06666"
                      Canvas.Top="9.0482"
                      Stretch="Fill"
                      Fill="{DynamicResource BlackBrush}"
                      Data="F1 M 20.4727,24.1087C 20.4727,25.2202 19.8462,26.1209 19.0743,26.1209C 18.3018,26.1209 17.6761,25.2202 17.6761,24.1087C 17.6761,22.9967 18.3018,22.0955 19.0743,22.0955C 19.8462,22.0955 20.4727,22.9967 20.4727,24.1087 Z M 31.7243,24.1087C 31.7243,25.2202 31.0982,26.1209 30.3259,26.1209C 29.5539,26.1209 28.9278,25.2202 28.9278,24.1087C 28.9278,22.9967 29.5539,22.0955 30.3259,22.0955C 31.0982,22.0955 31.7243,22.9967 31.7243,24.1087 Z M 25.0517,26.752C 25.0517,27.0417 24.8168,27.2766 24.5271,27.2766C 24.2372,27.2766 24.0026,27.0417 24.0026,26.752C 24.0026,26.4623 24.2372,26.2275 24.5271,26.2275C 24.8168,26.2275 25.0517,26.4623 25.0517,26.752 Z M 23.3051,28.0781C 23.2741,27.9901 23.3204,27.894 23.4079,27.8631C 23.4957,27.8319 23.5922,27.8782 23.6232,27.9657C 23.758,28.3467 24.1193,28.6027 24.5227,28.6027C 24.926,28.6027 25.2874,28.3467 25.4224,27.9657C 25.4533,27.8777 25.5497,27.8319 25.6377,27.8631C 25.7254,27.894 25.7712,27.9901 25.7403,28.0781C 25.5579,28.5933 25.0683,28.9396 24.5227,28.9396C 23.977,28.9396 23.4879,28.5933 23.3051,28.0781 Z M 45.4666,25.8891C 41.7383,25.1435 39.5769,25.1425 37.2874,25.2403C 37.2044,25.5172 37.1111,25.7865 37.004,26.0452C 39.2636,26.1111 41.5963,27.0572 45.4253,28.1372L 45.3796,28.2994C 41.5286,27.2128 39.1693,26.2736 36.9323,26.2122C 35.8027,28.7747 33.3519,30.4238 28.2447,30.9302C 29.1208,31.5249 30.0168,32.6517 30.0168,34.7794L 30.0168,40.2354C 30.0168,40.2354 30.1292,41.5855 31.3669,42.0354C 31.3669,42.0354 32.0976,42.5419 31.3103,42.8227C 31.3103,42.8227 27.8793,43.1041 27.8793,40.2917L 27.8793,36.1295C 27.8793,36.1295 28.0148,34.5951 27.2044,33.9639L 27.2044,40.7416C 27.2044,40.7416 27.2604,42.3729 28.1041,42.9917C 28.1041,42.9917 28.6664,44.0039 27.4294,43.723C 27.4294,43.723 25.0669,43.3855 24.9545,40.6292L 24.9004,33.7107L 24.3329,33.7107L 24.2791,40.6292C 24.1664,43.3855 21.8042,43.723 21.8042,43.723C 20.5667,44.0039 21.1292,42.9917 21.1292,42.9917C 21.9731,42.3729 22.029,40.7416 22.029,40.7416L 22.029,33.905C 21.2185,34.4786 21.3543,36.1295 21.3543,36.1295L 21.3543,40.2917C 21.3543,43.1041 17.923,42.8227 17.923,42.8227C 17.1355,42.5419 17.8667,42.0354 17.8667,42.0354C 19.1044,41.5855 19.2168,40.2354 19.2168,40.2354L 19.2168,36.4182C 13.9026,37.6038 12.8015,33.9086 12.8015,33.9086C 11.9575,31.7419 10.7337,31.1653 10.7337,31.1653C 9.03174,29.998 10.8601,30.0259 10.8601,30.0259C 12.7451,30.167 13.7299,31.9675 13.7299,31.9675C 15.4891,34.9934 18.4212,33.9118 19.3473,33.469C 19.6287,32.1551 20.3218,31.3786 21.0017,30.9219C 16.2126,30.4057 13.5206,28.7618 12.1552,26.2167C 9.892,26.2859 5.95582,27.5698 2.18687,28.6327L 2.1411,28.4706C 5.88063,27.4157 9.78237,26.1245 12.0677,26.0508C 11.9342,25.7865 11.815,25.5129 11.7081,25.231C 9.39687,25.1435 5.7021,24.8353 2.09986,25.5558L 2.06666,25.3903C 5.64753,24.6741 9.31942,24.975 11.6447,25.0595C 11.1589,23.6976 10.9597,22.1307 10.9597,20.3838C 10.9597,18.07 11.7961,16.1828 13.1661,14.7044C 12.9471,14.1686 12.2264,12.0107 13.3921,9.09626C 13.3921,9.09626 15.1775,8.53096 19.2226,11.2908C 20.9195,10.8253 22.7388,10.596 24.5393,10.596C 26.1759,10.596 27.8099,10.7853 29.3453,11.1691C 33.2647,8.54605 34.9973,9.09626 34.9973,9.09626C 35.9797,11.5523 35.6222,13.4712 35.3543,14.335C 36.886,15.8637 37.8295,17.8726 37.8295,20.3838C 37.8295,22.1347 37.7156,23.7049 37.3369,25.0693C 39.6423,24.9735 41.7864,24.981 45.5,25.7236L 45.4666,25.8891 Z M 32.8338,20.2655C 31.019,18.6227 27.9632,19.5073 24.4975,19.5073C 21.018,19.5073 17.9506,18.6315 16.1386,20.2856C 15.052,21.2782 14.4173,22.4741 14.4173,23.7621C 14.4173,29.142 18.9301,29.9804 24.4975,29.9804C 30.0642,29.9804 34.5775,29.8161 34.5775,23.7621C 34.5775,22.4656 33.934,21.2621 32.8338,20.2655 Z " />
            </Canvas>

            <Ellipse x:Key="AppThemeMenuIcon"
                     x:Shared="False"
                     Width="16"
                     Height="16"
                     StrokeThickness="1"
                     Stroke="{Binding BorderColorBrush, Mode=OneWay}"
                     Fill="{Binding ColorBrush, Mode=OneWay}" />
            <Ellipse x:Key="AccentMenuIcon"
                     x:Shared="False"
                     Width="16"
                     Height="16"
                     Fill="{Binding ColorBrush, Mode=OneWay}" />

            <Style x:Key="AppThemeMenuItemStyle"
                   TargetType="{x:Type MenuItem}"
                   BasedOn="{StaticResource MetroMenuItem}">
                <Setter Property="Command"
                        Value="{Binding ChangeAccentCommand}" />
                <Setter Property="Icon"
                        Value="{StaticResource AppThemeMenuIcon}" />
                <Setter Property="Header"
                        Value="{Binding Name, Mode=OneWay}" />
            </Style>

            <Style x:Key="AccentColorMenuItemStyle"
                   TargetType="{x:Type MenuItem}"
                   BasedOn="{StaticResource MetroMenuItem}">
                <Setter Property="Command"
                        Value="{Binding ChangeAccentCommand}" />
                <Setter Property="Icon"
                        Value="{StaticResource AccentMenuIcon}" />
                <Setter Property="Header"
                        Value="{Binding Name, Mode=OneWay}" />
            </Style>

            <Dialog:SimpleDialog x:Key="SimpleDialogTest"
                                 Title="This dialog allows arbitrary content. It will close in 5 seconds."
                                 x:Name="SimpleTestDialog">
                <TextBlock Height="30" Text="{Binding Artists[0].Name}" Foreground="{DynamicResource AccentBrush}" />
            </Dialog:SimpleDialog>

        </ResourceDictionary>
    </Window.Resources>

    <Controls:MetroWindow.LeftWindowCommands>
        <Controls:WindowCommands>
            <Button Click="LaunchMahAppsOnGitHub"
                    ToolTip="MahApps.Metro on GitHub">
                <Rectangle Width="22"
                           Height="22"
                           Fill="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}">
                    <Rectangle.OpacityMask>
                        <VisualBrush Stretch="Uniform"
                                     Visual="{StaticResource appbar_github}" />
                    </Rectangle.OpacityMask>
                </Rectangle>
            </Button>
        </Controls:WindowCommands>
    </Controls:MetroWindow.LeftWindowCommands>

    <Controls:MetroWindow.RightWindowCommands>
        <Controls:WindowCommands>
            <Button Click="LaunchSizeToContentDemo"
                    ToolTip="SizeToContent demo"
                    Content="STC" />
            <Button Click="LaunchVisualStudioDemo"
                    ToolTip="Visual Studio style demo"
                    Content="VS" />
            <Button Click="LaunchFlyoutDemo"
                    ToolTip="Flyouts demo window"
                    Content="Flyouts" />
            <Button Click="LaunchIcons"
                    ToolTip="All MahApp icons"
                    Content="Icons" />
            <Button Click="LauchCleanDemo"
                    ToolTip="Clean window style demo"
                    Content="Clean" />
            <!--<Button Click="LaunchRibbonDemo" Content="Ribbon Demo (.NET 4.5)" />-->
            <Button Click="InteropDemo"
                    ToolTip="The interop demo"
                    Content="Interop" />
            <Button Click="LaunchNavigationDemo"
                    ToolTip="Window navigation demo"
                    Content="Navigation" />
            <ToggleButton Content="ToggleButton"
                          ToolTip="Shows the toggle button magic"
                          x:Name="MagicToggleButton"
                          IsChecked="{Binding MagicToggleButtonIsChecked}" />
            <ToggleButton Content="Confirm quit"
                          ToolTip="Enable quit confirmation dialog on exit"
                          IsChecked="{Binding QuitConfirmationEnabled}" />
        </Controls:WindowCommands>
    </Controls:MetroWindow.RightWindowCommands>

    <Controls:MetroContentControl>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Menu Grid.Row="0"
                  Margin="5"
                  VerticalAlignment="Stretch"
                  HorizontalAlignment="Left">
                <MenuItem Header="Theme"
                          ItemsSource="{Binding AppThemes, Mode=OneWay}"
                          ItemContainerStyle="{StaticResource AppThemeMenuItemStyle}" />
                <MenuItem Header="Accent"
                          ItemsSource="{Binding AccentColors, Mode=OneWay}"
                          ItemContainerStyle="{StaticResource AccentColorMenuItemStyle}" />
                <MenuItem Header="Dialogs">
                    <MenuItem Header="Use Accent?"
                              x:Name="UseAccentForDialogsMenuItem"
                              IsCheckable="True" />
                    <Separator />
                    <MenuItem Click="ShowInputDialog"
                              Header="Show InputDialog" />
                    <MenuItem Click="ShowLoginDialog"
                              Header="Show LoginDialog" />
                    <MenuItem Click="ShowMessageDialog"
                              Header="Show MessageDialog" />
                    <MenuItem Click="ShowProgressDialog"
                              Header="Show ProgressDialog" />
                    <MenuItem Click="ShowSimpleDialog"
                              Header="Show SimpleDialog" />
                    <MenuItem Click="ShowDialogOutside"
                              Header="Show SimpleDialog Externally" />
                </MenuItem>
            </Menu>

            <Controls:MetroAnimatedSingleRowTabControl Grid.Row="1">
                <TabItem Header="buttons">
                    <exampleViews:ButtonsExample DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="text">
                    <exampleViews:TextExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="dates">
                    <exampleViews:DateExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="selection">
                    <exampleViews:SelectionExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="sliders and progress">
                    <exampleViews:SliderProgressExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="tabcontrol">
                    <exampleViews:TabControlExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="datagrid">
                    <exampleViews:DataGridExamples DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="colors">
                    <exampleViews:ColorExample DataContext="{Binding}" />
                </TabItem>
                <TabItem Header="others">
                    <exampleViews:OtherExamples DataContext="{Binding}" />
                </TabItem>
            </Controls:MetroAnimatedSingleRowTabControl>

        </Grid>
    </Controls:MetroContentControl>
</Controls:MetroWindow>
